package com.cn.wanxi.model;

import java.util.ArrayList;
import java.util.List;

public class NavModel extends CompanyModel{
    private String href;
    private String title;
    private String[] hrefs = {"/home", "/company"};
    private String[] titles = {"网站首页", "公司介绍"};
    private String[] aa = new String[5];
private CompanyModel companyModel;
    public NavModel() {
        aa[4] = "home";
        List<String> list = new ArrayList<>();//集合
        list.add("home");
    }

    private Integer age = 10/0;

    public static void main(String[] args) {
        CompanyModel companyModel = new CompanyModel();
        NavModel navModel = new NavModel();
        navModel.aaa(companyModel);
        navModel.aaa(navModel.age);

        System.out.println(navModel.age + "形参");
        System.out.println(companyModel.age + "引用");
    }

    private void aaa(int age) {
        age = 6;//改变传递过来的值
//age
    }

    private void aaa(CompanyModel companyModel) {
        companyModel.age = 6;
    }

    /**
     * 全参的构造方法
     *
     * @param href
     * @param title
     * @param hrefs
     * @param titles
     */
    public NavModel(String href, String title, String[] hrefs, String[] titles) {
        this.href = href;
        this.title = title;
        this.hrefs = hrefs;
        this.titles = titles;
    }

    /**
     * 属性   只要是类的  类包括属性，方法，代码块{}，构造方法（方法名和类名一致)
     * 变量   值可以变化的属性
     * 类变量  只要有static修饰的就叫类变量
     * 局部变量   只能用于局部，少数地方 最小地方
     * 成员变量  一定是全局变量
     * 全局变量
     * 常量  值不可以改变 final修饰，最终的，不可改变的 如果已经被赋值了，则不能被继续赋值
     */
    public String[] getHrefs() {
        return hrefs;
    }

    public String[] getTitles() {
        return titles;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}
